// $ANTLR 3.1.1 VariableWrapper.g 2009-10-05 23:27:43
// The variable 'variable' is assigned but its value is never used.
#pragma warning disable 168, 219
// Unreachable code detected.
#pragma warning disable 162
namespace  Core.ANTLRGrammars 
{

using System.Collections.Generic;


using System;
using Antlr.Runtime;
using Antlr.Runtime.Tree;using IList 		= System.Collections.IList;
using ArrayList 	= System.Collections.ArrayList;
using Stack 		= Antlr.Runtime.Collections.StackList;

using IDictionary	= System.Collections.IDictionary;
using Hashtable 	= System.Collections.Hashtable;


public partial class VariableWrapper : TreeParser
{
    public static readonly string[] tokenNames = new string[] 
	{
        "<invalid>", 
		"<EOR>", 
		"<DOWN>", 
		"<UP>", 
		"CPROGRAM", 
		"CDEVICE", 
		"CTYPE", 
		"CBLOCK", 
		"CSTATEMENT", 
		"CIFTE", 
		"CASSIGN", 
		"CWHILE", 
		"CFOR", 
		"CFORDEC", 
		"CUNARMIN", 
		"CMETHODNAME", 
		"CCALL", 
		"CINT", 
		"CFLOAT", 
		"CBOOL", 
		"CSYNCCALL", 
		"CASYNCCALL", 
		"CWAITTHECALL", 
		"CWAITANYCALL", 
		"CENDTHECALL", 
		"OBJECTNAME", 
		"MEMBERNAME", 
		"NODES", 
		"CGETSTATE", 
		"CBREAKPOINT", 
		"CREGMETHACCESS", 
		"CREGFUNCACCESS", 
		"CTERMINATEALL", 
		"CASYNCFUNCCALL", 
		"CSYNCFUNCCALL", 
		"CWAITFUNCFINISH", 
		"CDEFUN", 
		"PARAMS", 
		"PARAM", 
		"TERMINATEALL", 
		"OpIncDec", 
		"OpNegation", 
		"OpUnar", 
		"OpDivMul", 
		"OpAddSub", 
		"OpLogicalA", 
		"OpLogicalB", 
		"OpAnd", 
		"OpOr", 
		"TYPE", 
		"DBOOL", 
		"DEVICE", 
		"STATE", 
		"ENDDEVICE", 
		"INT", 
		"FLOAT", 
		"IF", 
		"THEN", 
		"ELSE", 
		"FOR", 
		"WHILE", 
		"WAIT", 
		"GO", 
		"ENDPRESSURE", 
		"VAR", 
		"BREAKPOINT", 
		"DEFUN", 
		"WS", 
		"NEWLINE", 
		"LINECOMMENT", 
		"ID", 
		"OBRACKET", 
		"CBRACKET", 
		"CURLYOBRACKET", 
		"CURLYCBRACKET", 
		"EQUALS", 
		"DOT", 
		"SEMI", 
		"COLON", 
		"COMMA", 
		"'('", 
		"')'"
    };

    public const int OpIncDec = 40;
    public const int WHILE = 60;
    public const int OpLogicalA = 45;
    public const int OBJECTNAME = 25;
    public const int OpAnd = 47;
    public const int CPROGRAM = 4;
    public const int OpLogicalB = 46;
    public const int OpNegation = 41;
    public const int CTYPE = 6;
    public const int DBOOL = 50;
    public const int FOR = 59;
    public const int PARAM = 38;
    public const int FLOAT = 55;
    public const int EQUALS = 75;
    public const int OpAddSub = 44;
    public const int CURLYCBRACKET = 74;
    public const int LINECOMMENT = 69;
    public const int ID = 70;
    public const int EOF = -1;
    public const int CASYNCCALL = 21;
    public const int CSYNCFUNCCALL = 34;
    public const int IF = 56;
    public const int TYPE = 49;
    public const int CIFTE = 9;
    public const int CWAITANYCALL = 23;
    public const int CWAITFUNCFINISH = 35;
    public const int THEN = 57;
    public const int CFORDEC = 13;
    public const int COMMA = 79;
    public const int OpDivMul = 43;
    public const int CDEVICE = 5;
    public const int CURLYOBRACKET = 73;
    public const int CSYNCCALL = 20;
    public const int CFOR = 12;
    public const int DEVICE = 51;
    public const int NODES = 27;
    public const int VAR = 64;
    public const int CREGFUNCACCESS = 31;
    public const int ENDDEVICE = 53;
    public const int DOT = 76;
    public const int CMETHODNAME = 15;
    public const int CBRACKET = 72;
    public const int PARAMS = 37;
    public const int MEMBERNAME = 26;
    public const int CWHILE = 11;
    public const int STATE = 52;
    public const int T__80 = 80;
    public const int T__81 = 81;
    public const int DEFUN = 66;
    public const int OpUnar = 42;
    public const int CTERMINATEALL = 32;
    public const int CREGMETHACCESS = 30;
    public const int ELSE = 58;
    public const int CDEFUN = 36;
    public const int CSTATEMENT = 8;
    public const int CUNARMIN = 14;
    public const int INT = 54;
    public const int WAIT = 61;
    public const int SEMI = 77;
    public const int CASSIGN = 10;
    public const int COLON = 78;
    public const int CBREAKPOINT = 29;
    public const int CINT = 17;
    public const int WS = 67;
    public const int TERMINATEALL = 39;
    public const int CENDTHECALL = 24;
    public const int NEWLINE = 68;
    public const int OpOr = 48;
    public const int ENDPRESSURE = 63;
    public const int CBLOCK = 7;
    public const int CCALL = 16;
    public const int CASYNCFUNCCALL = 33;
    public const int CGETSTATE = 28;
    public const int GO = 62;
    public const int OBRACKET = 71;
    public const int CBOOL = 19;
    public const int CFLOAT = 18;
    public const int BREAKPOINT = 65;
    public const int CWAITTHECALL = 22;

    // delegates
    // delegators



        public VariableWrapper(ITreeNodeStream input)
    		: this(input, new RecognizerSharedState()) {
        }

        public VariableWrapper(ITreeNodeStream input, RecognizerSharedState state)
    		: base(input, state) {
            InitializeCyclicDFAs();

             
        }
        
    protected ITreeAdaptor adaptor = new CommonTreeAdaptor();

    public ITreeAdaptor TreeAdaptor
    {
        get { return this.adaptor; }
        set {
    	this.adaptor = value;
    	}
    }

    override public string[] TokenNames {
		get { return VariableWrapper.tokenNames; }
    }

    override public string GrammarFileName {
		get { return "VariableWrapper.g"; }
    }


    	IList<string> WatchNames;


    protected class program_scope 
    {
        protected internal string DDname;
    }
    protected Stack program_stack = new Stack();

    public class program_return : TreeRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "program"
    // VariableWrapper.g:22:1: program[IList<string> watchnames] : ^( CPROGRAM ^( CDEVICE name= ID ) block ) ;
    public VariableWrapper.program_return program(IList<string> watchnames) // throws RecognitionException [1]
    {   
        program_stack.Push(new program_scope());
        VariableWrapper.program_return retval = new VariableWrapper.program_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree name = null;
        CommonTree CPROGRAM1 = null;
        CommonTree CDEVICE2 = null;
        VariableWrapper.block_return block3 = default(VariableWrapper.block_return);


        CommonTree name_tree=null;
        CommonTree CPROGRAM1_tree=null;
        CommonTree CDEVICE2_tree=null;


        	WatchNames = watchnames;

        try 
    	{
            // VariableWrapper.g:31:2: ( ^( CPROGRAM ^( CDEVICE name= ID ) block ) )
            // VariableWrapper.g:32:3: ^( CPROGRAM ^( CDEVICE name= ID ) block )
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	_last = (CommonTree)input.LT(1);
            	{
            	CommonTree _save_last_1 = _last;
            	CommonTree _first_1 = null;
            	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
            	CPROGRAM1=(CommonTree)Match(input,CPROGRAM,FOLLOW_CPROGRAM_in_program78); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{CPROGRAM1_tree = (CommonTree)adaptor.DupNode(CPROGRAM1);

            		root_1 = (CommonTree)adaptor.BecomeRoot(CPROGRAM1_tree, root_1);
            	}


            	Match(input, Token.DOWN, null); if (state.failed) return retval;
            	_last = (CommonTree)input.LT(1);
            	{
            	CommonTree _save_last_2 = _last;
            	CommonTree _first_2 = null;
            	CommonTree root_2 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
            	CDEVICE2=(CommonTree)Match(input,CDEVICE,FOLLOW_CDEVICE_in_program81); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{CDEVICE2_tree = (CommonTree)adaptor.DupNode(CDEVICE2);

            		root_2 = (CommonTree)adaptor.BecomeRoot(CDEVICE2_tree, root_2);
            	}


            	Match(input, Token.DOWN, null); if (state.failed) return retval;
            	_last = (CommonTree)input.LT(1);
            	name=(CommonTree)Match(input,ID,FOLLOW_ID_in_program85); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{name_tree = (CommonTree)adaptor.DupNode(name);

            		adaptor.AddChild(root_2, name_tree);
            	}

            	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_1, root_2);_last = _save_last_2;
            	}

            	if ( state.backtracking == 0 ) 
            	{
            	  ((program_scope)program_stack.Peek()).DDname = ((name != null) ? name.Text : null);
            	}
            	_last = (CommonTree)input.LT(1);
            	PushFollow(FOLLOW_block_in_program90);
            	block3 = block();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking==0 ) 
            	adaptor.AddChild(root_1, block3.Tree);

            	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
            	}


            	if ( state.backtracking==0 ) {
            	}
            }

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            }
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
            program_stack.Pop();
        }
        return retval;
    }
    // $ANTLR end "program"

    public class block_return : TreeRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "block"
    // VariableWrapper.g:36:1: block : ( varDecList )* blockStmt ;
    public VariableWrapper.block_return block() // throws RecognitionException [1]
    {   
        VariableWrapper.block_return retval = new VariableWrapper.block_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        VariableWrapper.varDecList_return varDecList4 = default(VariableWrapper.varDecList_return);

        VariableWrapper.blockStmt_return blockStmt5 = default(VariableWrapper.blockStmt_return);



        try 
    	{
            // VariableWrapper.g:36:8: ( ( varDecList )* blockStmt )
            // VariableWrapper.g:36:10: ( varDecList )* blockStmt
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	// VariableWrapper.g:36:10: ( varDecList )*
            	do 
            	{
            	    int alt1 = 2;
            	    int LA1_0 = input.LA(1);

            	    if ( (LA1_0 == CTYPE) )
            	    {
            	        alt1 = 1;
            	    }


            	    switch (alt1) 
            		{
            			case 1 :
            			    // VariableWrapper.g:36:11: varDecList
            			    {
            			    	_last = (CommonTree)input.LT(1);
            			    	PushFollow(FOLLOW_varDecList_in_block104);
            			    	varDecList4 = varDecList();
            			    	state.followingStackPointer--;
            			    	if (state.failed) return retval;
            			    	if ( state.backtracking==0 ) 
            			    	adaptor.AddChild(root_0, varDecList4.Tree);

            			    	if ( state.backtracking==0 ) {
            			    	}
            			    }
            			    break;

            			default:
            			    goto loop1;
            	    }
            	} while (true);

            	loop1:
            		;	// Stops C# compiler whining that label 'loop1' has no statements

            	_last = (CommonTree)input.LT(1);
            	PushFollow(FOLLOW_blockStmt_in_block108);
            	blockStmt5 = blockStmt();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking==0 ) 
            	adaptor.AddChild(root_0, blockStmt5.Tree);

            	if ( state.backtracking==0 ) {
            	}
            }

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            }
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "block"

    public class varDecList_return : TreeRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "varDecList"
    // VariableWrapper.g:39:1: varDecList : ( varDecListAtom )+ ;
    public VariableWrapper.varDecList_return varDecList() // throws RecognitionException [1]
    {   
        VariableWrapper.varDecList_return retval = new VariableWrapper.varDecList_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        VariableWrapper.varDecListAtom_return varDecListAtom6 = default(VariableWrapper.varDecListAtom_return);



        try 
    	{
            // VariableWrapper.g:39:12: ( ( varDecListAtom )+ )
            // VariableWrapper.g:39:14: ( varDecListAtom )+
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	// VariableWrapper.g:39:14: ( varDecListAtom )+
            	int cnt2 = 0;
            	do 
            	{
            	    int alt2 = 2;
            	    int LA2_0 = input.LA(1);

            	    if ( (LA2_0 == CTYPE) )
            	    {
            	        alt2 = 1;
            	    }


            	    switch (alt2) 
            		{
            			case 1 :
            			    // VariableWrapper.g:39:14: varDecListAtom
            			    {
            			    	_last = (CommonTree)input.LT(1);
            			    	PushFollow(FOLLOW_varDecListAtom_in_varDecList117);
            			    	varDecListAtom6 = varDecListAtom();
            			    	state.followingStackPointer--;
            			    	if (state.failed) return retval;
            			    	if ( state.backtracking==0 ) 
            			    	adaptor.AddChild(root_0, varDecListAtom6.Tree);

            			    	if ( state.backtracking==0 ) {
            			    	}
            			    }
            			    break;

            			default:
            			    if ( cnt2 >= 1 ) goto loop2;
            			    if ( state.backtracking > 0 ) {state.failed = true; return retval;}
            		            EarlyExitException eee =
            		                new EarlyExitException(2, input);
            		            throw eee;
            	    }
            	    cnt2++;
            	} while (true);

            	loop2:
            		;	// Stops C# compiler whinging that label 'loop2' has no statements


            	if ( state.backtracking==0 ) {
            	}
            }

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            }
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "varDecList"

    public class varDecListAtom_return : TreeRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "varDecListAtom"
    // VariableWrapper.g:42:1: varDecListAtom : ^( CTYPE TYPE peremDecList ) ;
    public VariableWrapper.varDecListAtom_return varDecListAtom() // throws RecognitionException [1]
    {   
        VariableWrapper.varDecListAtom_return retval = new VariableWrapper.varDecListAtom_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree CTYPE7 = null;
        CommonTree TYPE8 = null;
        VariableWrapper.peremDecList_return peremDecList9 = default(VariableWrapper.peremDecList_return);


        CommonTree CTYPE7_tree=null;
        CommonTree TYPE8_tree=null;

        try 
    	{
            // VariableWrapper.g:42:16: ( ^( CTYPE TYPE peremDecList ) )
            // VariableWrapper.g:42:19: ^( CTYPE TYPE peremDecList )
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	_last = (CommonTree)input.LT(1);
            	{
            	CommonTree _save_last_1 = _last;
            	CommonTree _first_1 = null;
            	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
            	CTYPE7=(CommonTree)Match(input,CTYPE,FOLLOW_CTYPE_in_varDecListAtom130); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{CTYPE7_tree = (CommonTree)adaptor.DupNode(CTYPE7);

            		root_1 = (CommonTree)adaptor.BecomeRoot(CTYPE7_tree, root_1);
            	}


            	Match(input, Token.DOWN, null); if (state.failed) return retval;
            	_last = (CommonTree)input.LT(1);
            	TYPE8=(CommonTree)Match(input,TYPE,FOLLOW_TYPE_in_varDecListAtom132); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{TYPE8_tree = (CommonTree)adaptor.DupNode(TYPE8);

            		adaptor.AddChild(root_1, TYPE8_tree);
            	}
            	_last = (CommonTree)input.LT(1);
            	PushFollow(FOLLOW_peremDecList_in_varDecListAtom134);
            	peremDecList9 = peremDecList();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking==0 ) 
            	adaptor.AddChild(root_1, peremDecList9.Tree);

            	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
            	}


            	if ( state.backtracking==0 ) {
            	}
            }

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            }
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "varDecListAtom"

    public class peremDecList_return : TreeRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "peremDecList"
    // VariableWrapper.g:45:1: peremDecList : ( ID )+ ;
    public VariableWrapper.peremDecList_return peremDecList() // throws RecognitionException [1]
    {   
        VariableWrapper.peremDecList_return retval = new VariableWrapper.peremDecList_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree ID10 = null;

        CommonTree ID10_tree=null;

        try 
    	{
            // VariableWrapper.g:45:14: ( ( ID )+ )
            // VariableWrapper.g:45:16: ( ID )+
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	// VariableWrapper.g:45:16: ( ID )+
            	int cnt3 = 0;
            	do 
            	{
            	    int alt3 = 2;
            	    int LA3_0 = input.LA(1);

            	    if ( (LA3_0 == ID) )
            	    {
            	        alt3 = 1;
            	    }


            	    switch (alt3) 
            		{
            			case 1 :
            			    // VariableWrapper.g:45:16: ID
            			    {
            			    	_last = (CommonTree)input.LT(1);
            			    	ID10=(CommonTree)Match(input,ID,FOLLOW_ID_in_peremDecList144); if (state.failed) return retval;
            			    	if ( state.backtracking == 0 )
            			    	{ID10_tree = (CommonTree)adaptor.DupNode(ID10);

            			    		adaptor.AddChild(root_0, ID10_tree);
            			    	}

            			    	if ( state.backtracking==0 ) {
            			    	}
            			    }
            			    break;

            			default:
            			    if ( cnt3 >= 1 ) goto loop3;
            			    if ( state.backtracking > 0 ) {state.failed = true; return retval;}
            		            EarlyExitException eee =
            		                new EarlyExitException(3, input);
            		            throw eee;
            	    }
            	    cnt3++;
            	} while (true);

            	loop3:
            		;	// Stops C# compiler whinging that label 'loop3' has no statements


            	if ( state.backtracking==0 ) {
            	}
            }

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            }
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "peremDecList"

    public class blockStmt_return : TreeRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "blockStmt"
    // VariableWrapper.g:48:1: blockStmt : ^( CSTATEMENT ( stmt )* ) ;
    public VariableWrapper.blockStmt_return blockStmt() // throws RecognitionException [1]
    {   
        VariableWrapper.blockStmt_return retval = new VariableWrapper.blockStmt_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree CSTATEMENT11 = null;
        VariableWrapper.stmt_return stmt12 = default(VariableWrapper.stmt_return);


        CommonTree CSTATEMENT11_tree=null;

        try 
    	{
            // VariableWrapper.g:48:11: ( ^( CSTATEMENT ( stmt )* ) )
            // VariableWrapper.g:48:13: ^( CSTATEMENT ( stmt )* )
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	_last = (CommonTree)input.LT(1);
            	{
            	CommonTree _save_last_1 = _last;
            	CommonTree _first_1 = null;
            	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
            	CSTATEMENT11=(CommonTree)Match(input,CSTATEMENT,FOLLOW_CSTATEMENT_in_blockStmt155); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{CSTATEMENT11_tree = (CommonTree)adaptor.DupNode(CSTATEMENT11);

            		root_1 = (CommonTree)adaptor.BecomeRoot(CSTATEMENT11_tree, root_1);
            	}


            	if ( input.LA(1) == Token.DOWN )
            	{
            	    Match(input, Token.DOWN, null); if (state.failed) return retval;
            	    // VariableWrapper.g:48:26: ( stmt )*
            	    do 
            	    {
            	        int alt4 = 2;
            	        int LA4_0 = input.LA(1);

            	        if ( ((LA4_0 >= CSTATEMENT && LA4_0 <= CFOR) || LA4_0 == CCALL || LA4_0 == CBREAKPOINT || (LA4_0 >= CTERMINATEALL && LA4_0 <= CWAITFUNCFINISH)) )
            	        {
            	            alt4 = 1;
            	        }


            	        switch (alt4) 
            	    	{
            	    		case 1 :
            	    		    // VariableWrapper.g:48:26: stmt
            	    		    {
            	    		    	_last = (CommonTree)input.LT(1);
            	    		    	PushFollow(FOLLOW_stmt_in_blockStmt157);
            	    		    	stmt12 = stmt();
            	    		    	state.followingStackPointer--;
            	    		    	if (state.failed) return retval;
            	    		    	if ( state.backtracking==0 ) 
            	    		    	adaptor.AddChild(root_1, stmt12.Tree);

            	    		    	if ( state.backtracking==0 ) {
            	    		    	}
            	    		    }
            	    		    break;

            	    		default:
            	    		    goto loop4;
            	        }
            	    } while (true);

            	    loop4:
            	    	;	// Stops C# compiler whining that label 'loop4' has no statements


            	    Match(input, Token.UP, null); if (state.failed) return retval;
            	}adaptor.AddChild(root_0, root_1);_last = _save_last_1;
            	}


            	if ( state.backtracking==0 ) {
            	}
            }

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            }
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "blockStmt"

    public class stmt_return : TreeRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "stmt"
    // VariableWrapper.g:52:1: stmt options {backtrack=true; } : ( assign | ifStmt | ^( CWHILE expr blockStmt ) | ^( CFOR assign expr assign blockStmt ) | deviceFuncID | blockStmt | ^( CBREAKPOINT INT ) | CTERMINATEALL | functionCall );
    public VariableWrapper.stmt_return stmt() // throws RecognitionException [1]
    {   
        VariableWrapper.stmt_return retval = new VariableWrapper.stmt_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree CWHILE15 = null;
        CommonTree CFOR18 = null;
        CommonTree CBREAKPOINT25 = null;
        CommonTree INT26 = null;
        CommonTree CTERMINATEALL27 = null;
        VariableWrapper.assign_return assign13 = default(VariableWrapper.assign_return);

        VariableWrapper.ifStmt_return ifStmt14 = default(VariableWrapper.ifStmt_return);

        VariableWrapper.expr_return expr16 = default(VariableWrapper.expr_return);

        VariableWrapper.blockStmt_return blockStmt17 = default(VariableWrapper.blockStmt_return);

        VariableWrapper.assign_return assign19 = default(VariableWrapper.assign_return);

        VariableWrapper.expr_return expr20 = default(VariableWrapper.expr_return);

        VariableWrapper.assign_return assign21 = default(VariableWrapper.assign_return);

        VariableWrapper.blockStmt_return blockStmt22 = default(VariableWrapper.blockStmt_return);

        VariableWrapper.deviceFuncID_return deviceFuncID23 = default(VariableWrapper.deviceFuncID_return);

        VariableWrapper.blockStmt_return blockStmt24 = default(VariableWrapper.blockStmt_return);

        VariableWrapper.functionCall_return functionCall28 = default(VariableWrapper.functionCall_return);


        CommonTree CWHILE15_tree=null;
        CommonTree CFOR18_tree=null;
        CommonTree CBREAKPOINT25_tree=null;
        CommonTree INT26_tree=null;
        CommonTree CTERMINATEALL27_tree=null;

        try 
    	{
            // VariableWrapper.g:54:1: ( assign | ifStmt | ^( CWHILE expr blockStmt ) | ^( CFOR assign expr assign blockStmt ) | deviceFuncID | blockStmt | ^( CBREAKPOINT INT ) | CTERMINATEALL | functionCall )
            int alt5 = 9;
            switch ( input.LA(1) ) 
            {
            case CASSIGN:
            	{
                alt5 = 1;
                }
                break;
            case CIFTE:
            	{
                alt5 = 2;
                }
                break;
            case CWHILE:
            	{
                alt5 = 3;
                }
                break;
            case CFOR:
            	{
                alt5 = 4;
                }
                break;
            case CCALL:
            	{
                alt5 = 5;
                }
                break;
            case CSTATEMENT:
            	{
                alt5 = 6;
                }
                break;
            case CBREAKPOINT:
            	{
                alt5 = 7;
                }
                break;
            case CTERMINATEALL:
            	{
                alt5 = 8;
                }
                break;
            case CASYNCFUNCCALL:
            case CSYNCFUNCCALL:
            case CWAITFUNCFINISH:
            	{
                alt5 = 9;
                }
                break;
            	default:
            	    if ( state.backtracking > 0 ) {state.failed = true; return retval;}
            	    NoViableAltException nvae_d5s0 =
            	        new NoViableAltException("", 5, 0, input);

            	    throw nvae_d5s0;
            }

            switch (alt5) 
            {
                case 1 :
                    // VariableWrapper.g:54:5: assign
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_assign_in_stmt179);
                    	assign13 = assign();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_0, assign13.Tree);

                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 2 :
                    // VariableWrapper.g:55:5: ifStmt
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_ifStmt_in_stmt186);
                    	ifStmt14 = ifStmt();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_0, ifStmt14.Tree);

                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 3 :
                    // VariableWrapper.g:56:5: ^( CWHILE expr blockStmt )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CWHILE15=(CommonTree)Match(input,CWHILE,FOLLOW_CWHILE_in_stmt193); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CWHILE15_tree = (CommonTree)adaptor.DupNode(CWHILE15);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(CWHILE15_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_expr_in_stmt195);
                    	expr16 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, expr16.Tree);
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_blockStmt_in_stmt197);
                    	blockStmt17 = blockStmt();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, blockStmt17.Tree);

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 4 :
                    // VariableWrapper.g:57:5: ^( CFOR assign expr assign blockStmt )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CFOR18=(CommonTree)Match(input,CFOR,FOLLOW_CFOR_in_stmt205); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CFOR18_tree = (CommonTree)adaptor.DupNode(CFOR18);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(CFOR18_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_assign_in_stmt207);
                    	assign19 = assign();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, assign19.Tree);
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_expr_in_stmt209);
                    	expr20 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, expr20.Tree);
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_assign_in_stmt211);
                    	assign21 = assign();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, assign21.Tree);
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_blockStmt_in_stmt213);
                    	blockStmt22 = blockStmt();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, blockStmt22.Tree);

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 5 :
                    // VariableWrapper.g:58:5: deviceFuncID
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_deviceFuncID_in_stmt220);
                    	deviceFuncID23 = deviceFuncID();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_0, deviceFuncID23.Tree);

                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 6 :
                    // VariableWrapper.g:59:5: blockStmt
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_blockStmt_in_stmt226);
                    	blockStmt24 = blockStmt();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_0, blockStmt24.Tree);

                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 7 :
                    // VariableWrapper.g:60:5: ^( CBREAKPOINT INT )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CBREAKPOINT25=(CommonTree)Match(input,CBREAKPOINT,FOLLOW_CBREAKPOINT_in_stmt233); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CBREAKPOINT25_tree = (CommonTree)adaptor.DupNode(CBREAKPOINT25);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(CBREAKPOINT25_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	INT26=(CommonTree)Match(input,INT,FOLLOW_INT_in_stmt235); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{INT26_tree = (CommonTree)adaptor.DupNode(INT26);

                    		adaptor.AddChild(root_1, INT26_tree);
                    	}

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 8 :
                    // VariableWrapper.g:61:5: CTERMINATEALL
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	CTERMINATEALL27=(CommonTree)Match(input,CTERMINATEALL,FOLLOW_CTERMINATEALL_in_stmt242); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CTERMINATEALL27_tree = (CommonTree)adaptor.DupNode(CTERMINATEALL27);

                    		adaptor.AddChild(root_0, CTERMINATEALL27_tree);
                    	}

                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 9 :
                    // VariableWrapper.g:62:5: functionCall
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_functionCall_in_stmt248);
                    	functionCall28 = functionCall();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_0, functionCall28.Tree);

                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;

            }
            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            }
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "stmt"

    public class assign_return : TreeRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "assign"
    // VariableWrapper.g:65:1: assign options {backtrack=true; } : ^( CASSIGN ID expr ) -> {WatchNames.Contains($ID.text)}? ^( CREGMETHACCESS ID[$ID.text + \":SetValue\"] expr ) -> ^( CASSIGN ID expr ) ;
    public VariableWrapper.assign_return assign() // throws RecognitionException [1]
    {   
        VariableWrapper.assign_return retval = new VariableWrapper.assign_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree CASSIGN29 = null;
        CommonTree ID30 = null;
        VariableWrapper.expr_return expr31 = default(VariableWrapper.expr_return);


        CommonTree CASSIGN29_tree=null;
        CommonTree ID30_tree=null;
        RewriteRuleNodeStream stream_ID = new RewriteRuleNodeStream(adaptor,"token ID");
        RewriteRuleNodeStream stream_CASSIGN = new RewriteRuleNodeStream(adaptor,"token CASSIGN");
        RewriteRuleSubtreeStream stream_expr = new RewriteRuleSubtreeStream(adaptor,"rule expr");
        try 
    	{
            // VariableWrapper.g:66:1: ( ^( CASSIGN ID expr ) -> {WatchNames.Contains($ID.text)}? ^( CREGMETHACCESS ID[$ID.text + \":SetValue\"] expr ) -> ^( CASSIGN ID expr ) )
            // VariableWrapper.g:67:2: ^( CASSIGN ID expr )
            {
            	_last = (CommonTree)input.LT(1);
            	{
            	CommonTree _save_last_1 = _last;
            	CommonTree _first_1 = null;
            	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
            	CASSIGN29=(CommonTree)Match(input,CASSIGN,FOLLOW_CASSIGN_in_assign268); if (state.failed) return retval; 
            	if ( state.backtracking==0 ) stream_CASSIGN.Add(CASSIGN29);



            	Match(input, Token.DOWN, null); if (state.failed) return retval;
            	_last = (CommonTree)input.LT(1);
            	ID30=(CommonTree)Match(input,ID,FOLLOW_ID_in_assign270); if (state.failed) return retval; 
            	if ( state.backtracking==0 ) stream_ID.Add(ID30);

            	_last = (CommonTree)input.LT(1);
            	PushFollow(FOLLOW_expr_in_assign272);
            	expr31 = expr();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking==0 ) stream_expr.Add(expr31.Tree);

            	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
            	}



            	// AST REWRITE
            	// elements:          CASSIGN, expr, ID, expr, ID
            	// token labels:      
            	// rule labels:       retval
            	// token list labels: 
            	// rule list labels:  
            	if ( state.backtracking==0 ) {
            	retval.Tree = root_0;
            	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

            	root_0 = (CommonTree)adaptor.GetNilNode();
            	// 68:3: -> {WatchNames.Contains($ID.text)}? ^( CREGMETHACCESS ID[$ID.text + \":SetValue\"] expr )
            	if (WatchNames.Contains(((ID30 != null) ? ID30.Text : null)))
            	{
            	    // VariableWrapper.g:68:39: ^( CREGMETHACCESS ID[$ID.text + \":SetValue\"] expr )
            	    {
            	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
            	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CREGMETHACCESS, "CREGMETHACCESS"), root_1);

            	    adaptor.AddChild(root_1, (CommonTree)adaptor.Create(ID, ((ID30 != null) ? ID30.Text : null) + ":SetValue"));
            	    adaptor.AddChild(root_1, stream_expr.NextTree());

            	    adaptor.AddChild(root_0, root_1);
            	    }

            	}
            	else // 69:3: -> ^( CASSIGN ID expr )
            	{
            	    // VariableWrapper.g:69:6: ^( CASSIGN ID expr )
            	    {
            	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
            	    root_1 = (CommonTree)adaptor.BecomeRoot(stream_CASSIGN.NextNode(), root_1);

            	    adaptor.AddChild(root_1, stream_ID.NextNode());
            	    adaptor.AddChild(root_1, stream_expr.NextTree());

            	    adaptor.AddChild(root_0, root_1);
            	    }

            	}

            	retval.Tree = root_0;}
            }

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            }
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "assign"

    public class ifStmt_return : TreeRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "ifStmt"
    // VariableWrapper.g:72:1: ifStmt options {backtrack=true; } : ^( CIFTE expr blockStmt ( blockStmt )? ) ;
    public VariableWrapper.ifStmt_return ifStmt() // throws RecognitionException [1]
    {   
        VariableWrapper.ifStmt_return retval = new VariableWrapper.ifStmt_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree CIFTE32 = null;
        VariableWrapper.expr_return expr33 = default(VariableWrapper.expr_return);

        VariableWrapper.blockStmt_return blockStmt34 = default(VariableWrapper.blockStmt_return);

        VariableWrapper.blockStmt_return blockStmt35 = default(VariableWrapper.blockStmt_return);


        CommonTree CIFTE32_tree=null;

        try 
    	{
            // VariableWrapper.g:74:1: ( ^( CIFTE expr blockStmt ( blockStmt )? ) )
            // VariableWrapper.g:75:2: ^( CIFTE expr blockStmt ( blockStmt )? )
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	_last = (CommonTree)input.LT(1);
            	{
            	CommonTree _save_last_1 = _last;
            	CommonTree _first_1 = null;
            	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
            	CIFTE32=(CommonTree)Match(input,CIFTE,FOLLOW_CIFTE_in_ifStmt322); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{CIFTE32_tree = (CommonTree)adaptor.DupNode(CIFTE32);

            		root_1 = (CommonTree)adaptor.BecomeRoot(CIFTE32_tree, root_1);
            	}


            	Match(input, Token.DOWN, null); if (state.failed) return retval;
            	_last = (CommonTree)input.LT(1);
            	PushFollow(FOLLOW_expr_in_ifStmt324);
            	expr33 = expr();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking==0 ) 
            	adaptor.AddChild(root_1, expr33.Tree);
            	_last = (CommonTree)input.LT(1);
            	PushFollow(FOLLOW_blockStmt_in_ifStmt326);
            	blockStmt34 = blockStmt();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking==0 ) 
            	adaptor.AddChild(root_1, blockStmt34.Tree);
            	// VariableWrapper.g:75:25: ( blockStmt )?
            	int alt6 = 2;
            	int LA6_0 = input.LA(1);

            	if ( (LA6_0 == CSTATEMENT) )
            	{
            	    alt6 = 1;
            	}
            	switch (alt6) 
            	{
            	    case 1 :
            	        // VariableWrapper.g:75:25: blockStmt
            	        {
            	        	_last = (CommonTree)input.LT(1);
            	        	PushFollow(FOLLOW_blockStmt_in_ifStmt328);
            	        	blockStmt35 = blockStmt();
            	        	state.followingStackPointer--;
            	        	if (state.failed) return retval;
            	        	if ( state.backtracking==0 ) 
            	        	adaptor.AddChild(root_1, blockStmt35.Tree);

            	        	if ( state.backtracking==0 ) {
            	        	}
            	        }
            	        break;

            	}


            	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
            	}


            	if ( state.backtracking==0 ) {
            	}
            }

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            }
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "ifStmt"

    public class expr_return : TreeRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "expr"
    // VariableWrapper.g:78:1: expr options {backtrack=true; } : ( ^( OpOr expr expr ) | ^( OpAnd expr expr ) | ^( OpLogicalB expr expr ) | ^( OpLogicalA expr expr ) | ^( OpAddSub expr expr ) | ^( OpDivMul expr expr ) | ^( OpNegation expr ) | ^( OpUnar expr ) | '(' expr ')' | atom );
    public VariableWrapper.expr_return expr() // throws RecognitionException [1]
    {   
        VariableWrapper.expr_return retval = new VariableWrapper.expr_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree OpOr36 = null;
        CommonTree OpAnd39 = null;
        CommonTree OpLogicalB42 = null;
        CommonTree OpLogicalA45 = null;
        CommonTree OpAddSub48 = null;
        CommonTree OpDivMul51 = null;
        CommonTree OpNegation54 = null;
        CommonTree OpUnar56 = null;
        CommonTree char_literal58 = null;
        CommonTree char_literal60 = null;
        VariableWrapper.expr_return expr37 = default(VariableWrapper.expr_return);

        VariableWrapper.expr_return expr38 = default(VariableWrapper.expr_return);

        VariableWrapper.expr_return expr40 = default(VariableWrapper.expr_return);

        VariableWrapper.expr_return expr41 = default(VariableWrapper.expr_return);

        VariableWrapper.expr_return expr43 = default(VariableWrapper.expr_return);

        VariableWrapper.expr_return expr44 = default(VariableWrapper.expr_return);

        VariableWrapper.expr_return expr46 = default(VariableWrapper.expr_return);

        VariableWrapper.expr_return expr47 = default(VariableWrapper.expr_return);

        VariableWrapper.expr_return expr49 = default(VariableWrapper.expr_return);

        VariableWrapper.expr_return expr50 = default(VariableWrapper.expr_return);

        VariableWrapper.expr_return expr52 = default(VariableWrapper.expr_return);

        VariableWrapper.expr_return expr53 = default(VariableWrapper.expr_return);

        VariableWrapper.expr_return expr55 = default(VariableWrapper.expr_return);

        VariableWrapper.expr_return expr57 = default(VariableWrapper.expr_return);

        VariableWrapper.expr_return expr59 = default(VariableWrapper.expr_return);

        VariableWrapper.atom_return atom61 = default(VariableWrapper.atom_return);


        CommonTree OpOr36_tree=null;
        CommonTree OpAnd39_tree=null;
        CommonTree OpLogicalB42_tree=null;
        CommonTree OpLogicalA45_tree=null;
        CommonTree OpAddSub48_tree=null;
        CommonTree OpDivMul51_tree=null;
        CommonTree OpNegation54_tree=null;
        CommonTree OpUnar56_tree=null;
        CommonTree char_literal58_tree=null;
        CommonTree char_literal60_tree=null;

        try 
    	{
            // VariableWrapper.g:79:1: ( ^( OpOr expr expr ) | ^( OpAnd expr expr ) | ^( OpLogicalB expr expr ) | ^( OpLogicalA expr expr ) | ^( OpAddSub expr expr ) | ^( OpDivMul expr expr ) | ^( OpNegation expr ) | ^( OpUnar expr ) | '(' expr ')' | atom )
            int alt7 = 10;
            switch ( input.LA(1) ) 
            {
            case OpOr:
            	{
                alt7 = 1;
                }
                break;
            case OpAnd:
            	{
                alt7 = 2;
                }
                break;
            case OpLogicalB:
            	{
                alt7 = 3;
                }
                break;
            case OpLogicalA:
            	{
                alt7 = 4;
                }
                break;
            case OpAddSub:
            	{
                alt7 = 5;
                }
                break;
            case OpDivMul:
            	{
                alt7 = 6;
                }
                break;
            case OpNegation:
            	{
                alt7 = 7;
                }
                break;
            case OpUnar:
            	{
                alt7 = 8;
                }
                break;
            case 80:
            	{
                alt7 = 9;
                }
                break;
            case CINT:
            case CFLOAT:
            case CBOOL:
            case OBJECTNAME:
            case CGETSTATE:
            case ID:
            	{
                alt7 = 10;
                }
                break;
            	default:
            	    if ( state.backtracking > 0 ) {state.failed = true; return retval;}
            	    NoViableAltException nvae_d7s0 =
            	        new NoViableAltException("", 7, 0, input);

            	    throw nvae_d7s0;
            }

            switch (alt7) 
            {
                case 1 :
                    // VariableWrapper.g:80:4: ^( OpOr expr expr )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	OpOr36=(CommonTree)Match(input,OpOr,FOLLOW_OpOr_in_expr351); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{OpOr36_tree = (CommonTree)adaptor.DupNode(OpOr36);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(OpOr36_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_expr_in_expr353);
                    	expr37 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, expr37.Tree);
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_expr_in_expr355);
                    	expr38 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, expr38.Tree);

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 2 :
                    // VariableWrapper.g:81:5: ^( OpAnd expr expr )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	OpAnd39=(CommonTree)Match(input,OpAnd,FOLLOW_OpAnd_in_expr364); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{OpAnd39_tree = (CommonTree)adaptor.DupNode(OpAnd39);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(OpAnd39_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_expr_in_expr366);
                    	expr40 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, expr40.Tree);
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_expr_in_expr368);
                    	expr41 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, expr41.Tree);

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 3 :
                    // VariableWrapper.g:82:5: ^( OpLogicalB expr expr )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	OpLogicalB42=(CommonTree)Match(input,OpLogicalB,FOLLOW_OpLogicalB_in_expr377); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{OpLogicalB42_tree = (CommonTree)adaptor.DupNode(OpLogicalB42);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(OpLogicalB42_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_expr_in_expr379);
                    	expr43 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, expr43.Tree);
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_expr_in_expr381);
                    	expr44 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, expr44.Tree);

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 4 :
                    // VariableWrapper.g:83:5: ^( OpLogicalA expr expr )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	OpLogicalA45=(CommonTree)Match(input,OpLogicalA,FOLLOW_OpLogicalA_in_expr390); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{OpLogicalA45_tree = (CommonTree)adaptor.DupNode(OpLogicalA45);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(OpLogicalA45_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_expr_in_expr392);
                    	expr46 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, expr46.Tree);
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_expr_in_expr394);
                    	expr47 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, expr47.Tree);

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 5 :
                    // VariableWrapper.g:84:5: ^( OpAddSub expr expr )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	OpAddSub48=(CommonTree)Match(input,OpAddSub,FOLLOW_OpAddSub_in_expr403); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{OpAddSub48_tree = (CommonTree)adaptor.DupNode(OpAddSub48);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(OpAddSub48_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_expr_in_expr405);
                    	expr49 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, expr49.Tree);
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_expr_in_expr407);
                    	expr50 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, expr50.Tree);

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 6 :
                    // VariableWrapper.g:85:5: ^( OpDivMul expr expr )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	OpDivMul51=(CommonTree)Match(input,OpDivMul,FOLLOW_OpDivMul_in_expr416); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{OpDivMul51_tree = (CommonTree)adaptor.DupNode(OpDivMul51);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(OpDivMul51_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_expr_in_expr418);
                    	expr52 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, expr52.Tree);
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_expr_in_expr420);
                    	expr53 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, expr53.Tree);

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 7 :
                    // VariableWrapper.g:86:5: ^( OpNegation expr )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	OpNegation54=(CommonTree)Match(input,OpNegation,FOLLOW_OpNegation_in_expr429); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{OpNegation54_tree = (CommonTree)adaptor.DupNode(OpNegation54);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(OpNegation54_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_expr_in_expr431);
                    	expr55 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, expr55.Tree);

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 8 :
                    // VariableWrapper.g:87:5: ^( OpUnar expr )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	OpUnar56=(CommonTree)Match(input,OpUnar,FOLLOW_OpUnar_in_expr440); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{OpUnar56_tree = (CommonTree)adaptor.DupNode(OpUnar56);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(OpUnar56_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_expr_in_expr442);
                    	expr57 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_1, expr57.Tree);

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 9 :
                    // VariableWrapper.g:88:5: '(' expr ')'
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	char_literal58=(CommonTree)Match(input,80,FOLLOW_80_in_expr450); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{char_literal58_tree = (CommonTree)adaptor.DupNode(char_literal58);

                    		adaptor.AddChild(root_0, char_literal58_tree);
                    	}
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_expr_in_expr452);
                    	expr59 = expr();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_0, expr59.Tree);
                    	_last = (CommonTree)input.LT(1);
                    	char_literal60=(CommonTree)Match(input,81,FOLLOW_81_in_expr454); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{char_literal60_tree = (CommonTree)adaptor.DupNode(char_literal60);

                    		adaptor.AddChild(root_0, char_literal60_tree);
                    	}

                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 10 :
                    // VariableWrapper.g:89:5: atom
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_atom_in_expr460);
                    	atom61 = atom();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_0, atom61.Tree);

                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;

            }
            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            }
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "expr"

    public class atom_return : TreeRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "atom"
    // VariableWrapper.g:92:1: atom options {backtrack=true; } : ( ID -> {WatchNames.Contains($ID.text)}? ^( CREGFUNCACCESS ID[$ID.text + \":GetValue\"] ) -> ID | ^( CFLOAT FLOAT ) | ^( CINT INT ) | ^( CBOOL DBOOL ) | ^( OBJECTNAME ID ) ^( NODES ( ID )* ) ^( MEMBERNAME ID ) | ^( CGETSTATE ^( OBJECTNAME ID ) ^( NODES ( ID )* ) ) );
    public VariableWrapper.atom_return atom() // throws RecognitionException [1]
    {   
        VariableWrapper.atom_return retval = new VariableWrapper.atom_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree ID62 = null;
        CommonTree CFLOAT63 = null;
        CommonTree FLOAT64 = null;
        CommonTree CINT65 = null;
        CommonTree INT66 = null;
        CommonTree CBOOL67 = null;
        CommonTree DBOOL68 = null;
        CommonTree OBJECTNAME69 = null;
        CommonTree ID70 = null;
        CommonTree NODES71 = null;
        CommonTree ID72 = null;
        CommonTree MEMBERNAME73 = null;
        CommonTree ID74 = null;
        CommonTree CGETSTATE75 = null;
        CommonTree OBJECTNAME76 = null;
        CommonTree ID77 = null;
        CommonTree NODES78 = null;
        CommonTree ID79 = null;

        CommonTree ID62_tree=null;
        CommonTree CFLOAT63_tree=null;
        CommonTree FLOAT64_tree=null;
        CommonTree CINT65_tree=null;
        CommonTree INT66_tree=null;
        CommonTree CBOOL67_tree=null;
        CommonTree DBOOL68_tree=null;
        CommonTree OBJECTNAME69_tree=null;
        CommonTree ID70_tree=null;
        CommonTree NODES71_tree=null;
        CommonTree ID72_tree=null;
        CommonTree MEMBERNAME73_tree=null;
        CommonTree ID74_tree=null;
        CommonTree CGETSTATE75_tree=null;
        CommonTree OBJECTNAME76_tree=null;
        CommonTree ID77_tree=null;
        CommonTree NODES78_tree=null;
        CommonTree ID79_tree=null;
        RewriteRuleNodeStream stream_ID = new RewriteRuleNodeStream(adaptor,"token ID");

        try 
    	{
            // VariableWrapper.g:97:2: ( ID -> {WatchNames.Contains($ID.text)}? ^( CREGFUNCACCESS ID[$ID.text + \":GetValue\"] ) -> ID | ^( CFLOAT FLOAT ) | ^( CINT INT ) | ^( CBOOL DBOOL ) | ^( OBJECTNAME ID ) ^( NODES ( ID )* ) ^( MEMBERNAME ID ) | ^( CGETSTATE ^( OBJECTNAME ID ) ^( NODES ( ID )* ) ) )
            int alt10 = 6;
            switch ( input.LA(1) ) 
            {
            case ID:
            	{
                alt10 = 1;
                }
                break;
            case CFLOAT:
            	{
                alt10 = 2;
                }
                break;
            case CINT:
            	{
                alt10 = 3;
                }
                break;
            case CBOOL:
            	{
                alt10 = 4;
                }
                break;
            case OBJECTNAME:
            	{
                alt10 = 5;
                }
                break;
            case CGETSTATE:
            	{
                alt10 = 6;
                }
                break;
            	default:
            	    if ( state.backtracking > 0 ) {state.failed = true; return retval;}
            	    NoViableAltException nvae_d10s0 =
            	        new NoViableAltException("", 10, 0, input);

            	    throw nvae_d10s0;
            }

            switch (alt10) 
            {
                case 1 :
                    // VariableWrapper.g:98:2: ID
                    {
                    	_last = (CommonTree)input.LT(1);
                    	ID62=(CommonTree)Match(input,ID,FOLLOW_ID_in_atom482); if (state.failed) return retval; 
                    	if ( state.backtracking==0 ) stream_ID.Add(ID62);



                    	// AST REWRITE
                    	// elements:          ID, ID
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	if ( state.backtracking==0 ) {
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "token retval", (retval!=null ? retval.Tree : null));

                    	root_0 = (CommonTree)adaptor.GetNilNode();
                    	// 98:5: -> {WatchNames.Contains($ID.text)}? ^( CREGFUNCACCESS ID[$ID.text + \":GetValue\"] )
                    	if (WatchNames.Contains(((ID62 != null) ? ID62.Text : null)))
                    	{
                    	    // VariableWrapper.g:98:41: ^( CREGFUNCACCESS ID[$ID.text + \":GetValue\"] )
                    	    {
                    	    CommonTree root_1 = (CommonTree)adaptor.GetNilNode();
                    	    root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CREGFUNCACCESS, "CREGFUNCACCESS"), root_1);

                    	    adaptor.AddChild(root_1, (CommonTree)adaptor.Create(ID, ((ID62 != null) ? ID62.Text : null) + ":GetValue"));

                    	    adaptor.AddChild(root_0, root_1);
                    	    }

                    	}
                    	else // 99:2: -> ID
                    	{
                    	    adaptor.AddChild(root_0, stream_ID.NextNode());

                    	}

                    	retval.Tree = root_0;}
                    }
                    break;
                case 2 :
                    // VariableWrapper.g:100:4: ^( CFLOAT FLOAT )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CFLOAT63=(CommonTree)Match(input,CFLOAT,FOLLOW_CFLOAT_in_atom504); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CFLOAT63_tree = (CommonTree)adaptor.DupNode(CFLOAT63);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(CFLOAT63_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	FLOAT64=(CommonTree)Match(input,FLOAT,FOLLOW_FLOAT_in_atom506); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{FLOAT64_tree = (CommonTree)adaptor.DupNode(FLOAT64);

                    		adaptor.AddChild(root_1, FLOAT64_tree);
                    	}

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 3 :
                    // VariableWrapper.g:101:4: ^( CINT INT )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CINT65=(CommonTree)Match(input,CINT,FOLLOW_CINT_in_atom513); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CINT65_tree = (CommonTree)adaptor.DupNode(CINT65);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(CINT65_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	INT66=(CommonTree)Match(input,INT,FOLLOW_INT_in_atom515); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{INT66_tree = (CommonTree)adaptor.DupNode(INT66);

                    		adaptor.AddChild(root_1, INT66_tree);
                    	}

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 4 :
                    // VariableWrapper.g:102:4: ^( CBOOL DBOOL )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CBOOL67=(CommonTree)Match(input,CBOOL,FOLLOW_CBOOL_in_atom522); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CBOOL67_tree = (CommonTree)adaptor.DupNode(CBOOL67);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(CBOOL67_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	DBOOL68=(CommonTree)Match(input,DBOOL,FOLLOW_DBOOL_in_atom524); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{DBOOL68_tree = (CommonTree)adaptor.DupNode(DBOOL68);

                    		adaptor.AddChild(root_1, DBOOL68_tree);
                    	}

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 5 :
                    // VariableWrapper.g:103:4: ^( OBJECTNAME ID ) ^( NODES ( ID )* ) ^( MEMBERNAME ID )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	OBJECTNAME69=(CommonTree)Match(input,OBJECTNAME,FOLLOW_OBJECTNAME_in_atom531); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{OBJECTNAME69_tree = (CommonTree)adaptor.DupNode(OBJECTNAME69);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(OBJECTNAME69_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	ID70=(CommonTree)Match(input,ID,FOLLOW_ID_in_atom533); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{ID70_tree = (CommonTree)adaptor.DupNode(ID70);

                    		adaptor.AddChild(root_1, ID70_tree);
                    	}

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	NODES71=(CommonTree)Match(input,NODES,FOLLOW_NODES_in_atom537); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{NODES71_tree = (CommonTree)adaptor.DupNode(NODES71);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(NODES71_tree, root_1);
                    	}


                    	if ( input.LA(1) == Token.DOWN )
                    	{
                    	    Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	    // VariableWrapper.g:103:29: ( ID )*
                    	    do 
                    	    {
                    	        int alt8 = 2;
                    	        int LA8_0 = input.LA(1);

                    	        if ( (LA8_0 == ID) )
                    	        {
                    	            alt8 = 1;
                    	        }


                    	        switch (alt8) 
                    	    	{
                    	    		case 1 :
                    	    		    // VariableWrapper.g:103:29: ID
                    	    		    {
                    	    		    	_last = (CommonTree)input.LT(1);
                    	    		    	ID72=(CommonTree)Match(input,ID,FOLLOW_ID_in_atom539); if (state.failed) return retval;
                    	    		    	if ( state.backtracking == 0 )
                    	    		    	{ID72_tree = (CommonTree)adaptor.DupNode(ID72);

                    	    		    		adaptor.AddChild(root_1, ID72_tree);
                    	    		    	}

                    	    		    	if ( state.backtracking==0 ) {
                    	    		    	}
                    	    		    }
                    	    		    break;

                    	    		default:
                    	    		    goto loop8;
                    	        }
                    	    } while (true);

                    	    loop8:
                    	    	;	// Stops C# compiler whining that label 'loop8' has no statements


                    	    Match(input, Token.UP, null); if (state.failed) return retval;
                    	}adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	MEMBERNAME73=(CommonTree)Match(input,MEMBERNAME,FOLLOW_MEMBERNAME_in_atom544); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{MEMBERNAME73_tree = (CommonTree)adaptor.DupNode(MEMBERNAME73);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(MEMBERNAME73_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	ID74=(CommonTree)Match(input,ID,FOLLOW_ID_in_atom546); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{ID74_tree = (CommonTree)adaptor.DupNode(ID74);

                    		adaptor.AddChild(root_1, ID74_tree);
                    	}

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 6 :
                    // VariableWrapper.g:104:4: ^( CGETSTATE ^( OBJECTNAME ID ) ^( NODES ( ID )* ) )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CGETSTATE75=(CommonTree)Match(input,CGETSTATE,FOLLOW_CGETSTATE_in_atom553); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CGETSTATE75_tree = (CommonTree)adaptor.DupNode(CGETSTATE75);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(CGETSTATE75_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_2 = _last;
                    	CommonTree _first_2 = null;
                    	CommonTree root_2 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	OBJECTNAME76=(CommonTree)Match(input,OBJECTNAME,FOLLOW_OBJECTNAME_in_atom556); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{OBJECTNAME76_tree = (CommonTree)adaptor.DupNode(OBJECTNAME76);

                    		root_2 = (CommonTree)adaptor.BecomeRoot(OBJECTNAME76_tree, root_2);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	ID77=(CommonTree)Match(input,ID,FOLLOW_ID_in_atom558); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{ID77_tree = (CommonTree)adaptor.DupNode(ID77);

                    		adaptor.AddChild(root_2, ID77_tree);
                    	}

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_1, root_2);_last = _save_last_2;
                    	}

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_2 = _last;
                    	CommonTree _first_2 = null;
                    	CommonTree root_2 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	NODES78=(CommonTree)Match(input,NODES,FOLLOW_NODES_in_atom562); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{NODES78_tree = (CommonTree)adaptor.DupNode(NODES78);

                    		root_2 = (CommonTree)adaptor.BecomeRoot(NODES78_tree, root_2);
                    	}


                    	if ( input.LA(1) == Token.DOWN )
                    	{
                    	    Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	    // VariableWrapper.g:104:41: ( ID )*
                    	    do 
                    	    {
                    	        int alt9 = 2;
                    	        int LA9_0 = input.LA(1);

                    	        if ( (LA9_0 == ID) )
                    	        {
                    	            alt9 = 1;
                    	        }


                    	        switch (alt9) 
                    	    	{
                    	    		case 1 :
                    	    		    // VariableWrapper.g:104:41: ID
                    	    		    {
                    	    		    	_last = (CommonTree)input.LT(1);
                    	    		    	ID79=(CommonTree)Match(input,ID,FOLLOW_ID_in_atom564); if (state.failed) return retval;
                    	    		    	if ( state.backtracking == 0 )
                    	    		    	{ID79_tree = (CommonTree)adaptor.DupNode(ID79);

                    	    		    		adaptor.AddChild(root_2, ID79_tree);
                    	    		    	}

                    	    		    	if ( state.backtracking==0 ) {
                    	    		    	}
                    	    		    }
                    	    		    break;

                    	    		default:
                    	    		    goto loop9;
                    	        }
                    	    } while (true);

                    	    loop9:
                    	    	;	// Stops C# compiler whining that label 'loop9' has no statements


                    	    Match(input, Token.UP, null); if (state.failed) return retval;
                    	}adaptor.AddChild(root_1, root_2);_last = _save_last_2;
                    	}


                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;

            }
            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            }
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "atom"

    public class qualifiedName_return : TreeRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "qualifiedName"
    // VariableWrapper.g:107:1: qualifiedName : ^( OBJECTNAME ID ) ^( NODES ( ID )* ) ^( MEMBERNAME ID ) ;
    public VariableWrapper.qualifiedName_return qualifiedName() // throws RecognitionException [1]
    {   
        VariableWrapper.qualifiedName_return retval = new VariableWrapper.qualifiedName_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree OBJECTNAME80 = null;
        CommonTree ID81 = null;
        CommonTree NODES82 = null;
        CommonTree ID83 = null;
        CommonTree MEMBERNAME84 = null;
        CommonTree ID85 = null;

        CommonTree OBJECTNAME80_tree=null;
        CommonTree ID81_tree=null;
        CommonTree NODES82_tree=null;
        CommonTree ID83_tree=null;
        CommonTree MEMBERNAME84_tree=null;
        CommonTree ID85_tree=null;

        try 
    	{
            // VariableWrapper.g:107:15: ( ^( OBJECTNAME ID ) ^( NODES ( ID )* ) ^( MEMBERNAME ID ) )
            // VariableWrapper.g:108:2: ^( OBJECTNAME ID ) ^( NODES ( ID )* ) ^( MEMBERNAME ID )
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	_last = (CommonTree)input.LT(1);
            	{
            	CommonTree _save_last_1 = _last;
            	CommonTree _first_1 = null;
            	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
            	OBJECTNAME80=(CommonTree)Match(input,OBJECTNAME,FOLLOW_OBJECTNAME_in_qualifiedName578); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{OBJECTNAME80_tree = (CommonTree)adaptor.DupNode(OBJECTNAME80);

            		root_1 = (CommonTree)adaptor.BecomeRoot(OBJECTNAME80_tree, root_1);
            	}


            	Match(input, Token.DOWN, null); if (state.failed) return retval;
            	_last = (CommonTree)input.LT(1);
            	ID81=(CommonTree)Match(input,ID,FOLLOW_ID_in_qualifiedName580); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{ID81_tree = (CommonTree)adaptor.DupNode(ID81);

            		adaptor.AddChild(root_1, ID81_tree);
            	}

            	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
            	}

            	_last = (CommonTree)input.LT(1);
            	{
            	CommonTree _save_last_1 = _last;
            	CommonTree _first_1 = null;
            	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
            	NODES82=(CommonTree)Match(input,NODES,FOLLOW_NODES_in_qualifiedName584); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{NODES82_tree = (CommonTree)adaptor.DupNode(NODES82);

            		root_1 = (CommonTree)adaptor.BecomeRoot(NODES82_tree, root_1);
            	}


            	if ( input.LA(1) == Token.DOWN )
            	{
            	    Match(input, Token.DOWN, null); if (state.failed) return retval;
            	    // VariableWrapper.g:108:27: ( ID )*
            	    do 
            	    {
            	        int alt11 = 2;
            	        int LA11_0 = input.LA(1);

            	        if ( (LA11_0 == ID) )
            	        {
            	            alt11 = 1;
            	        }


            	        switch (alt11) 
            	    	{
            	    		case 1 :
            	    		    // VariableWrapper.g:108:27: ID
            	    		    {
            	    		    	_last = (CommonTree)input.LT(1);
            	    		    	ID83=(CommonTree)Match(input,ID,FOLLOW_ID_in_qualifiedName586); if (state.failed) return retval;
            	    		    	if ( state.backtracking == 0 )
            	    		    	{ID83_tree = (CommonTree)adaptor.DupNode(ID83);

            	    		    		adaptor.AddChild(root_1, ID83_tree);
            	    		    	}

            	    		    	if ( state.backtracking==0 ) {
            	    		    	}
            	    		    }
            	    		    break;

            	    		default:
            	    		    goto loop11;
            	        }
            	    } while (true);

            	    loop11:
            	    	;	// Stops C# compiler whining that label 'loop11' has no statements


            	    Match(input, Token.UP, null); if (state.failed) return retval;
            	}adaptor.AddChild(root_0, root_1);_last = _save_last_1;
            	}

            	_last = (CommonTree)input.LT(1);
            	{
            	CommonTree _save_last_1 = _last;
            	CommonTree _first_1 = null;
            	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
            	MEMBERNAME84=(CommonTree)Match(input,MEMBERNAME,FOLLOW_MEMBERNAME_in_qualifiedName591); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{MEMBERNAME84_tree = (CommonTree)adaptor.DupNode(MEMBERNAME84);

            		root_1 = (CommonTree)adaptor.BecomeRoot(MEMBERNAME84_tree, root_1);
            	}


            	Match(input, Token.DOWN, null); if (state.failed) return retval;
            	_last = (CommonTree)input.LT(1);
            	ID85=(CommonTree)Match(input,ID,FOLLOW_ID_in_qualifiedName593); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{ID85_tree = (CommonTree)adaptor.DupNode(ID85);

            		adaptor.AddChild(root_1, ID85_tree);
            	}

            	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
            	}


            	if ( state.backtracking==0 ) {
            	}
            }

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            }
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "qualifiedName"

    public class deviceFuncID_return : TreeRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "deviceFuncID"
    // VariableWrapper.g:111:1: deviceFuncID : ( ^( CCALL ^( CSYNCCALL qualifiedName ) ) | ^( CCALL ^( CASYNCCALL qualifiedName ) ) | ^( CCALL ^( CENDTHECALL qualifiedName ) ) | ^( CCALL ^( CWAITTHECALL qualifiedName ) ) | ^( CCALL ^( CWAITANYCALL qualifiedName ) ) );
    public VariableWrapper.deviceFuncID_return deviceFuncID() // throws RecognitionException [1]
    {   
        VariableWrapper.deviceFuncID_return retval = new VariableWrapper.deviceFuncID_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree CCALL86 = null;
        CommonTree CSYNCCALL87 = null;
        CommonTree CCALL89 = null;
        CommonTree CASYNCCALL90 = null;
        CommonTree CCALL92 = null;
        CommonTree CENDTHECALL93 = null;
        CommonTree CCALL95 = null;
        CommonTree CWAITTHECALL96 = null;
        CommonTree CCALL98 = null;
        CommonTree CWAITANYCALL99 = null;
        VariableWrapper.qualifiedName_return qualifiedName88 = default(VariableWrapper.qualifiedName_return);

        VariableWrapper.qualifiedName_return qualifiedName91 = default(VariableWrapper.qualifiedName_return);

        VariableWrapper.qualifiedName_return qualifiedName94 = default(VariableWrapper.qualifiedName_return);

        VariableWrapper.qualifiedName_return qualifiedName97 = default(VariableWrapper.qualifiedName_return);

        VariableWrapper.qualifiedName_return qualifiedName100 = default(VariableWrapper.qualifiedName_return);


        CommonTree CCALL86_tree=null;
        CommonTree CSYNCCALL87_tree=null;
        CommonTree CCALL89_tree=null;
        CommonTree CASYNCCALL90_tree=null;
        CommonTree CCALL92_tree=null;
        CommonTree CENDTHECALL93_tree=null;
        CommonTree CCALL95_tree=null;
        CommonTree CWAITTHECALL96_tree=null;
        CommonTree CCALL98_tree=null;
        CommonTree CWAITANYCALL99_tree=null;

        try 
    	{
            // VariableWrapper.g:112:1: ( ^( CCALL ^( CSYNCCALL qualifiedName ) ) | ^( CCALL ^( CASYNCCALL qualifiedName ) ) | ^( CCALL ^( CENDTHECALL qualifiedName ) ) | ^( CCALL ^( CWAITTHECALL qualifiedName ) ) | ^( CCALL ^( CWAITANYCALL qualifiedName ) ) )
            int alt12 = 5;
            int LA12_0 = input.LA(1);

            if ( (LA12_0 == CCALL) )
            {
                int LA12_1 = input.LA(2);

                if ( (LA12_1 == DOWN) )
                {
                    switch ( input.LA(3) ) 
                    {
                    case CSYNCCALL:
                    	{
                        alt12 = 1;
                        }
                        break;
                    case CASYNCCALL:
                    	{
                        alt12 = 2;
                        }
                        break;
                    case CENDTHECALL:
                    	{
                        alt12 = 3;
                        }
                        break;
                    case CWAITTHECALL:
                    	{
                        alt12 = 4;
                        }
                        break;
                    case CWAITANYCALL:
                    	{
                        alt12 = 5;
                        }
                        break;
                    	default:
                    	    if ( state.backtracking > 0 ) {state.failed = true; return retval;}
                    	    NoViableAltException nvae_d12s2 =
                    	        new NoViableAltException("", 12, 2, input);

                    	    throw nvae_d12s2;
                    }

                }
                else 
                {
                    if ( state.backtracking > 0 ) {state.failed = true; return retval;}
                    NoViableAltException nvae_d12s1 =
                        new NoViableAltException("", 12, 1, input);

                    throw nvae_d12s1;
                }
            }
            else 
            {
                if ( state.backtracking > 0 ) {state.failed = true; return retval;}
                NoViableAltException nvae_d12s0 =
                    new NoViableAltException("", 12, 0, input);

                throw nvae_d12s0;
            }
            switch (alt12) 
            {
                case 1 :
                    // VariableWrapper.g:113:10: ^( CCALL ^( CSYNCCALL qualifiedName ) )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CCALL86=(CommonTree)Match(input,CCALL,FOLLOW_CCALL_in_deviceFuncID622); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CCALL86_tree = (CommonTree)adaptor.DupNode(CCALL86);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(CCALL86_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_2 = _last;
                    	CommonTree _first_2 = null;
                    	CommonTree root_2 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CSYNCCALL87=(CommonTree)Match(input,CSYNCCALL,FOLLOW_CSYNCCALL_in_deviceFuncID625); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CSYNCCALL87_tree = (CommonTree)adaptor.DupNode(CSYNCCALL87);

                    		root_2 = (CommonTree)adaptor.BecomeRoot(CSYNCCALL87_tree, root_2);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_qualifiedName_in_deviceFuncID627);
                    	qualifiedName88 = qualifiedName();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_2, qualifiedName88.Tree);

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_1, root_2);_last = _save_last_2;
                    	}


                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 2 :
                    // VariableWrapper.g:114:4: ^( CCALL ^( CASYNCCALL qualifiedName ) )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CCALL89=(CommonTree)Match(input,CCALL,FOLLOW_CCALL_in_deviceFuncID638); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CCALL89_tree = (CommonTree)adaptor.DupNode(CCALL89);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(CCALL89_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_2 = _last;
                    	CommonTree _first_2 = null;
                    	CommonTree root_2 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CASYNCCALL90=(CommonTree)Match(input,CASYNCCALL,FOLLOW_CASYNCCALL_in_deviceFuncID641); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CASYNCCALL90_tree = (CommonTree)adaptor.DupNode(CASYNCCALL90);

                    		root_2 = (CommonTree)adaptor.BecomeRoot(CASYNCCALL90_tree, root_2);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_qualifiedName_in_deviceFuncID643);
                    	qualifiedName91 = qualifiedName();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_2, qualifiedName91.Tree);

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_1, root_2);_last = _save_last_2;
                    	}


                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 3 :
                    // VariableWrapper.g:115:4: ^( CCALL ^( CENDTHECALL qualifiedName ) )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CCALL92=(CommonTree)Match(input,CCALL,FOLLOW_CCALL_in_deviceFuncID651); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CCALL92_tree = (CommonTree)adaptor.DupNode(CCALL92);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(CCALL92_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_2 = _last;
                    	CommonTree _first_2 = null;
                    	CommonTree root_2 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CENDTHECALL93=(CommonTree)Match(input,CENDTHECALL,FOLLOW_CENDTHECALL_in_deviceFuncID654); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CENDTHECALL93_tree = (CommonTree)adaptor.DupNode(CENDTHECALL93);

                    		root_2 = (CommonTree)adaptor.BecomeRoot(CENDTHECALL93_tree, root_2);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_qualifiedName_in_deviceFuncID656);
                    	qualifiedName94 = qualifiedName();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_2, qualifiedName94.Tree);

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_1, root_2);_last = _save_last_2;
                    	}


                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 4 :
                    // VariableWrapper.g:116:4: ^( CCALL ^( CWAITTHECALL qualifiedName ) )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CCALL95=(CommonTree)Match(input,CCALL,FOLLOW_CCALL_in_deviceFuncID664); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CCALL95_tree = (CommonTree)adaptor.DupNode(CCALL95);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(CCALL95_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_2 = _last;
                    	CommonTree _first_2 = null;
                    	CommonTree root_2 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CWAITTHECALL96=(CommonTree)Match(input,CWAITTHECALL,FOLLOW_CWAITTHECALL_in_deviceFuncID667); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CWAITTHECALL96_tree = (CommonTree)adaptor.DupNode(CWAITTHECALL96);

                    		root_2 = (CommonTree)adaptor.BecomeRoot(CWAITTHECALL96_tree, root_2);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_qualifiedName_in_deviceFuncID669);
                    	qualifiedName97 = qualifiedName();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_2, qualifiedName97.Tree);

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_1, root_2);_last = _save_last_2;
                    	}


                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 5 :
                    // VariableWrapper.g:117:4: ^( CCALL ^( CWAITANYCALL qualifiedName ) )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CCALL98=(CommonTree)Match(input,CCALL,FOLLOW_CCALL_in_deviceFuncID677); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CCALL98_tree = (CommonTree)adaptor.DupNode(CCALL98);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(CCALL98_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_2 = _last;
                    	CommonTree _first_2 = null;
                    	CommonTree root_2 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CWAITANYCALL99=(CommonTree)Match(input,CWAITANYCALL,FOLLOW_CWAITANYCALL_in_deviceFuncID680); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CWAITANYCALL99_tree = (CommonTree)adaptor.DupNode(CWAITANYCALL99);

                    		root_2 = (CommonTree)adaptor.BecomeRoot(CWAITANYCALL99_tree, root_2);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_qualifiedName_in_deviceFuncID682);
                    	qualifiedName100 = qualifiedName();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_2, qualifiedName100.Tree);

                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_1, root_2);_last = _save_last_2;
                    	}


                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;

            }
            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            }
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "deviceFuncID"

    public class functionCall_return : TreeRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "functionCall"
    // VariableWrapper.g:121:1: functionCall : ( ^( CASYNCFUNCCALL ID ( parameter )* ) | ^( CWAITFUNCFINISH ID ( parameter )* ) | ^( CSYNCFUNCCALL ID ( parameter )* ) );
    public VariableWrapper.functionCall_return functionCall() // throws RecognitionException [1]
    {   
        VariableWrapper.functionCall_return retval = new VariableWrapper.functionCall_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree CASYNCFUNCCALL101 = null;
        CommonTree ID102 = null;
        CommonTree CWAITFUNCFINISH104 = null;
        CommonTree ID105 = null;
        CommonTree CSYNCFUNCCALL107 = null;
        CommonTree ID108 = null;
        VariableWrapper.parameter_return parameter103 = default(VariableWrapper.parameter_return);

        VariableWrapper.parameter_return parameter106 = default(VariableWrapper.parameter_return);

        VariableWrapper.parameter_return parameter109 = default(VariableWrapper.parameter_return);


        CommonTree CASYNCFUNCCALL101_tree=null;
        CommonTree ID102_tree=null;
        CommonTree CWAITFUNCFINISH104_tree=null;
        CommonTree ID105_tree=null;
        CommonTree CSYNCFUNCCALL107_tree=null;
        CommonTree ID108_tree=null;

        try 
    	{
            // VariableWrapper.g:122:1: ( ^( CASYNCFUNCCALL ID ( parameter )* ) | ^( CWAITFUNCFINISH ID ( parameter )* ) | ^( CSYNCFUNCCALL ID ( parameter )* ) )
            int alt16 = 3;
            switch ( input.LA(1) ) 
            {
            case CASYNCFUNCCALL:
            	{
                alt16 = 1;
                }
                break;
            case CWAITFUNCFINISH:
            	{
                alt16 = 2;
                }
                break;
            case CSYNCFUNCCALL:
            	{
                alt16 = 3;
                }
                break;
            	default:
            	    if ( state.backtracking > 0 ) {state.failed = true; return retval;}
            	    NoViableAltException nvae_d16s0 =
            	        new NoViableAltException("", 16, 0, input);

            	    throw nvae_d16s0;
            }

            switch (alt16) 
            {
                case 1 :
                    // VariableWrapper.g:123:4: ^( CASYNCFUNCCALL ID ( parameter )* )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CASYNCFUNCCALL101=(CommonTree)Match(input,CASYNCFUNCCALL,FOLLOW_CASYNCFUNCCALL_in_functionCall699); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CASYNCFUNCCALL101_tree = (CommonTree)adaptor.DupNode(CASYNCFUNCCALL101);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(CASYNCFUNCCALL101_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	ID102=(CommonTree)Match(input,ID,FOLLOW_ID_in_functionCall701); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{ID102_tree = (CommonTree)adaptor.DupNode(ID102);

                    		adaptor.AddChild(root_1, ID102_tree);
                    	}
                    	// VariableWrapper.g:123:24: ( parameter )*
                    	do 
                    	{
                    	    int alt13 = 2;
                    	    int LA13_0 = input.LA(1);

                    	    if ( (LA13_0 == PARAM) )
                    	    {
                    	        alt13 = 1;
                    	    }


                    	    switch (alt13) 
                    		{
                    			case 1 :
                    			    // VariableWrapper.g:123:24: parameter
                    			    {
                    			    	_last = (CommonTree)input.LT(1);
                    			    	PushFollow(FOLLOW_parameter_in_functionCall703);
                    			    	parameter103 = parameter();
                    			    	state.followingStackPointer--;
                    			    	if (state.failed) return retval;
                    			    	if ( state.backtracking==0 ) 
                    			    	adaptor.AddChild(root_1, parameter103.Tree);

                    			    	if ( state.backtracking==0 ) {
                    			    	}
                    			    }
                    			    break;

                    			default:
                    			    goto loop13;
                    	    }
                    	} while (true);

                    	loop13:
                    		;	// Stops C# compiler whining that label 'loop13' has no statements


                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 2 :
                    // VariableWrapper.g:124:6: ^( CWAITFUNCFINISH ID ( parameter )* )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CWAITFUNCFINISH104=(CommonTree)Match(input,CWAITFUNCFINISH,FOLLOW_CWAITFUNCFINISH_in_functionCall713); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CWAITFUNCFINISH104_tree = (CommonTree)adaptor.DupNode(CWAITFUNCFINISH104);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(CWAITFUNCFINISH104_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	ID105=(CommonTree)Match(input,ID,FOLLOW_ID_in_functionCall715); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{ID105_tree = (CommonTree)adaptor.DupNode(ID105);

                    		adaptor.AddChild(root_1, ID105_tree);
                    	}
                    	// VariableWrapper.g:124:27: ( parameter )*
                    	do 
                    	{
                    	    int alt14 = 2;
                    	    int LA14_0 = input.LA(1);

                    	    if ( (LA14_0 == PARAM) )
                    	    {
                    	        alt14 = 1;
                    	    }


                    	    switch (alt14) 
                    		{
                    			case 1 :
                    			    // VariableWrapper.g:124:27: parameter
                    			    {
                    			    	_last = (CommonTree)input.LT(1);
                    			    	PushFollow(FOLLOW_parameter_in_functionCall717);
                    			    	parameter106 = parameter();
                    			    	state.followingStackPointer--;
                    			    	if (state.failed) return retval;
                    			    	if ( state.backtracking==0 ) 
                    			    	adaptor.AddChild(root_1, parameter106.Tree);

                    			    	if ( state.backtracking==0 ) {
                    			    	}
                    			    }
                    			    break;

                    			default:
                    			    goto loop14;
                    	    }
                    	} while (true);

                    	loop14:
                    		;	// Stops C# compiler whining that label 'loop14' has no statements


                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 3 :
                    // VariableWrapper.g:125:5: ^( CSYNCFUNCCALL ID ( parameter )* )
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	{
                    	CommonTree _save_last_1 = _last;
                    	CommonTree _first_1 = null;
                    	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
                    	CSYNCFUNCCALL107=(CommonTree)Match(input,CSYNCFUNCCALL,FOLLOW_CSYNCFUNCCALL_in_functionCall726); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{CSYNCFUNCCALL107_tree = (CommonTree)adaptor.DupNode(CSYNCFUNCCALL107);

                    		root_1 = (CommonTree)adaptor.BecomeRoot(CSYNCFUNCCALL107_tree, root_1);
                    	}


                    	Match(input, Token.DOWN, null); if (state.failed) return retval;
                    	_last = (CommonTree)input.LT(1);
                    	ID108=(CommonTree)Match(input,ID,FOLLOW_ID_in_functionCall728); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{ID108_tree = (CommonTree)adaptor.DupNode(ID108);

                    		adaptor.AddChild(root_1, ID108_tree);
                    	}
                    	// VariableWrapper.g:125:24: ( parameter )*
                    	do 
                    	{
                    	    int alt15 = 2;
                    	    int LA15_0 = input.LA(1);

                    	    if ( (LA15_0 == PARAM) )
                    	    {
                    	        alt15 = 1;
                    	    }


                    	    switch (alt15) 
                    		{
                    			case 1 :
                    			    // VariableWrapper.g:125:24: parameter
                    			    {
                    			    	_last = (CommonTree)input.LT(1);
                    			    	PushFollow(FOLLOW_parameter_in_functionCall730);
                    			    	parameter109 = parameter();
                    			    	state.followingStackPointer--;
                    			    	if (state.failed) return retval;
                    			    	if ( state.backtracking==0 ) 
                    			    	adaptor.AddChild(root_1, parameter109.Tree);

                    			    	if ( state.backtracking==0 ) {
                    			    	}
                    			    }
                    			    break;

                    			default:
                    			    goto loop15;
                    	    }
                    	} while (true);

                    	loop15:
                    		;	// Stops C# compiler whining that label 'loop15' has no statements


                    	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
                    	}


                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;

            }
            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            }
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "functionCall"

    public class parameter_return : TreeRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "parameter"
    // VariableWrapper.g:129:1: parameter : ^( PARAM parameterValue ) ;
    public VariableWrapper.parameter_return parameter() // throws RecognitionException [1]
    {   
        VariableWrapper.parameter_return retval = new VariableWrapper.parameter_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree PARAM110 = null;
        VariableWrapper.parameterValue_return parameterValue111 = default(VariableWrapper.parameterValue_return);


        CommonTree PARAM110_tree=null;

        try 
    	{
            // VariableWrapper.g:129:11: ( ^( PARAM parameterValue ) )
            // VariableWrapper.g:130:2: ^( PARAM parameterValue )
            {
            	root_0 = (CommonTree)adaptor.GetNilNode();

            	_last = (CommonTree)input.LT(1);
            	{
            	CommonTree _save_last_1 = _last;
            	CommonTree _first_1 = null;
            	CommonTree root_1 = (CommonTree)adaptor.GetNilNode();_last = (CommonTree)input.LT(1);
            	PARAM110=(CommonTree)Match(input,PARAM,FOLLOW_PARAM_in_parameter745); if (state.failed) return retval;
            	if ( state.backtracking == 0 )
            	{PARAM110_tree = (CommonTree)adaptor.DupNode(PARAM110);

            		root_1 = (CommonTree)adaptor.BecomeRoot(PARAM110_tree, root_1);
            	}


            	Match(input, Token.DOWN, null); if (state.failed) return retval;
            	_last = (CommonTree)input.LT(1);
            	PushFollow(FOLLOW_parameterValue_in_parameter747);
            	parameterValue111 = parameterValue();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking==0 ) 
            	adaptor.AddChild(root_1, parameterValue111.Tree);

            	Match(input, Token.UP, null); if (state.failed) return retval;adaptor.AddChild(root_0, root_1);_last = _save_last_1;
            	}


            	if ( state.backtracking==0 ) {
            	}
            }

            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            }
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "parameter"

    public class parameterValue_return : TreeRuleReturnScope
    {
        private CommonTree tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (CommonTree) value; }
        }
    };

    // $ANTLR start "parameterValue"
    // VariableWrapper.g:133:1: parameterValue : ( ID | INT | qualifiedName );
    public VariableWrapper.parameterValue_return parameterValue() // throws RecognitionException [1]
    {   
        VariableWrapper.parameterValue_return retval = new VariableWrapper.parameterValue_return();
        retval.Start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree ID112 = null;
        CommonTree INT113 = null;
        VariableWrapper.qualifiedName_return qualifiedName114 = default(VariableWrapper.qualifiedName_return);


        CommonTree ID112_tree=null;
        CommonTree INT113_tree=null;

        try 
    	{
            // VariableWrapper.g:133:16: ( ID | INT | qualifiedName )
            int alt17 = 3;
            switch ( input.LA(1) ) 
            {
            case ID:
            	{
                alt17 = 1;
                }
                break;
            case INT:
            	{
                alt17 = 2;
                }
                break;
            case OBJECTNAME:
            	{
                alt17 = 3;
                }
                break;
            	default:
            	    if ( state.backtracking > 0 ) {state.failed = true; return retval;}
            	    NoViableAltException nvae_d17s0 =
            	        new NoViableAltException("", 17, 0, input);

            	    throw nvae_d17s0;
            }

            switch (alt17) 
            {
                case 1 :
                    // VariableWrapper.g:134:4: ID
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	ID112=(CommonTree)Match(input,ID,FOLLOW_ID_in_parameterValue760); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{ID112_tree = (CommonTree)adaptor.DupNode(ID112);

                    		adaptor.AddChild(root_0, ID112_tree);
                    	}

                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 2 :
                    // VariableWrapper.g:135:6: INT
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	INT113=(CommonTree)Match(input,INT,FOLLOW_INT_in_parameterValue769); if (state.failed) return retval;
                    	if ( state.backtracking == 0 )
                    	{INT113_tree = (CommonTree)adaptor.DupNode(INT113);

                    		adaptor.AddChild(root_0, INT113_tree);
                    	}

                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;
                case 3 :
                    // VariableWrapper.g:136:5: qualifiedName
                    {
                    	root_0 = (CommonTree)adaptor.GetNilNode();

                    	_last = (CommonTree)input.LT(1);
                    	PushFollow(FOLLOW_qualifiedName_in_parameterValue777);
                    	qualifiedName114 = qualifiedName();
                    	state.followingStackPointer--;
                    	if (state.failed) return retval;
                    	if ( state.backtracking==0 ) 
                    	adaptor.AddChild(root_0, qualifiedName114.Tree);

                    	if ( state.backtracking==0 ) {
                    	}
                    }
                    break;

            }
            if ( state.backtracking==0 )
            {	retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
            }
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "parameterValue"

    // Delegated rules


	private void InitializeCyclicDFAs()
	{
	}

 

    public static readonly BitSet FOLLOW_CPROGRAM_in_program78 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_CDEVICE_in_program81 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_ID_in_program85 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_block_in_program90 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_varDecList_in_block104 = new BitSet(new ulong[]{0x0000000000000140UL});
    public static readonly BitSet FOLLOW_blockStmt_in_block108 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_varDecListAtom_in_varDecList117 = new BitSet(new ulong[]{0x0000000000000142UL});
    public static readonly BitSet FOLLOW_CTYPE_in_varDecListAtom130 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_TYPE_in_varDecListAtom132 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_peremDecList_in_varDecListAtom134 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_ID_in_peremDecList144 = new BitSet(new ulong[]{0x0000000000000002UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_CSTATEMENT_in_blockStmt155 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_stmt_in_blockStmt157 = new BitSet(new ulong[]{0x0000000F20011F08UL});
    public static readonly BitSet FOLLOW_assign_in_stmt179 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_ifStmt_in_stmt186 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_CWHILE_in_stmt193 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_expr_in_stmt195 = new BitSet(new ulong[]{0x0000000000000100UL});
    public static readonly BitSet FOLLOW_blockStmt_in_stmt197 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_CFOR_in_stmt205 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_assign_in_stmt207 = new BitSet(new ulong[]{0x0001FE00120E0000UL,0x0000000000010040UL});
    public static readonly BitSet FOLLOW_expr_in_stmt209 = new BitSet(new ulong[]{0x0000000000000400UL});
    public static readonly BitSet FOLLOW_assign_in_stmt211 = new BitSet(new ulong[]{0x0000000000000100UL});
    public static readonly BitSet FOLLOW_blockStmt_in_stmt213 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_deviceFuncID_in_stmt220 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_blockStmt_in_stmt226 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_CBREAKPOINT_in_stmt233 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_INT_in_stmt235 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_CTERMINATEALL_in_stmt242 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_functionCall_in_stmt248 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_CASSIGN_in_assign268 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_ID_in_assign270 = new BitSet(new ulong[]{0x0001FE00120E0000UL,0x0000000000010040UL});
    public static readonly BitSet FOLLOW_expr_in_assign272 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_CIFTE_in_ifStmt322 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_expr_in_ifStmt324 = new BitSet(new ulong[]{0x0000000000000100UL});
    public static readonly BitSet FOLLOW_blockStmt_in_ifStmt326 = new BitSet(new ulong[]{0x0000000000000108UL});
    public static readonly BitSet FOLLOW_blockStmt_in_ifStmt328 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_OpOr_in_expr351 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_expr_in_expr353 = new BitSet(new ulong[]{0x0001FE00120E0000UL,0x0000000000010040UL});
    public static readonly BitSet FOLLOW_expr_in_expr355 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_OpAnd_in_expr364 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_expr_in_expr366 = new BitSet(new ulong[]{0x0001FE00120E0000UL,0x0000000000010040UL});
    public static readonly BitSet FOLLOW_expr_in_expr368 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_OpLogicalB_in_expr377 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_expr_in_expr379 = new BitSet(new ulong[]{0x0001FE00120E0000UL,0x0000000000010040UL});
    public static readonly BitSet FOLLOW_expr_in_expr381 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_OpLogicalA_in_expr390 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_expr_in_expr392 = new BitSet(new ulong[]{0x0001FE00120E0000UL,0x0000000000010040UL});
    public static readonly BitSet FOLLOW_expr_in_expr394 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_OpAddSub_in_expr403 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_expr_in_expr405 = new BitSet(new ulong[]{0x0001FE00120E0000UL,0x0000000000010040UL});
    public static readonly BitSet FOLLOW_expr_in_expr407 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_OpDivMul_in_expr416 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_expr_in_expr418 = new BitSet(new ulong[]{0x0001FE00120E0000UL,0x0000000000010040UL});
    public static readonly BitSet FOLLOW_expr_in_expr420 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_OpNegation_in_expr429 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_expr_in_expr431 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_OpUnar_in_expr440 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_expr_in_expr442 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_80_in_expr450 = new BitSet(new ulong[]{0x0001FE00120E0000UL,0x0000000000010040UL});
    public static readonly BitSet FOLLOW_expr_in_expr452 = new BitSet(new ulong[]{0x0000000000000000UL,0x0000000000020000UL});
    public static readonly BitSet FOLLOW_81_in_expr454 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_atom_in_expr460 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_ID_in_atom482 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_CFLOAT_in_atom504 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_FLOAT_in_atom506 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_CINT_in_atom513 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_INT_in_atom515 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_CBOOL_in_atom522 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_DBOOL_in_atom524 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_OBJECTNAME_in_atom531 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_ID_in_atom533 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_NODES_in_atom537 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_ID_in_atom539 = new BitSet(new ulong[]{0x0000000000000008UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_MEMBERNAME_in_atom544 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_ID_in_atom546 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_CGETSTATE_in_atom553 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_OBJECTNAME_in_atom556 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_ID_in_atom558 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_NODES_in_atom562 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_ID_in_atom564 = new BitSet(new ulong[]{0x0000000000000008UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_OBJECTNAME_in_qualifiedName578 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_ID_in_qualifiedName580 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_NODES_in_qualifiedName584 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_ID_in_qualifiedName586 = new BitSet(new ulong[]{0x0000000000000008UL,0x0000000000000040UL});
    public static readonly BitSet FOLLOW_MEMBERNAME_in_qualifiedName591 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_ID_in_qualifiedName593 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_CCALL_in_deviceFuncID622 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_CSYNCCALL_in_deviceFuncID625 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_qualifiedName_in_deviceFuncID627 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_CCALL_in_deviceFuncID638 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_CASYNCCALL_in_deviceFuncID641 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_qualifiedName_in_deviceFuncID643 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_CCALL_in_deviceFuncID651 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_CENDTHECALL_in_deviceFuncID654 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_qualifiedName_in_deviceFuncID656 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_CCALL_in_deviceFuncID664 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_CWAITTHECALL_in_deviceFuncID667 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_qualifiedName_in_deviceFuncID669 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_CCALL_in_deviceFuncID677 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_CWAITANYCALL_in_deviceFuncID680 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_qualifiedName_in_deviceFuncID682 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_CASYNCFUNCCALL_in_functionCall699 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_ID_in_functionCall701 = new BitSet(new ulong[]{0x0000004000000008UL});
    public static readonly BitSet FOLLOW_parameter_in_functionCall703 = new BitSet(new ulong[]{0x0000004000000008UL});
    public static readonly BitSet FOLLOW_CWAITFUNCFINISH_in_functionCall713 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_ID_in_functionCall715 = new BitSet(new ulong[]{0x0000004000000008UL});
    public static readonly BitSet FOLLOW_parameter_in_functionCall717 = new BitSet(new ulong[]{0x0000004000000008UL});
    public static readonly BitSet FOLLOW_CSYNCFUNCCALL_in_functionCall726 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_ID_in_functionCall728 = new BitSet(new ulong[]{0x0000004000000008UL});
    public static readonly BitSet FOLLOW_parameter_in_functionCall730 = new BitSet(new ulong[]{0x0000004000000008UL});
    public static readonly BitSet FOLLOW_PARAM_in_parameter745 = new BitSet(new ulong[]{0x0000000000000004UL});
    public static readonly BitSet FOLLOW_parameterValue_in_parameter747 = new BitSet(new ulong[]{0x0000000000000008UL});
    public static readonly BitSet FOLLOW_ID_in_parameterValue760 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_INT_in_parameterValue769 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_qualifiedName_in_parameterValue777 = new BitSet(new ulong[]{0x0000000000000002UL});

}
}